home *** CD-ROM | disk | FTP | other *** search
- Path: dartvax.dartmouth.edu!NewsWatcher!user
- From: Robert.Lendvai@dartmouth.edu (Robert Lendvai)
- Newsgroups: comp.lang.c++
- Subject: Re: [] overload..(newbie in distress)
- Date: Sun, 21 Jan 1996 01:17:54 -1000
- Organization: Dartmouth College
- Message-ID: <Robert.Lendvai-2101960118330001@129.170.80.94>
- References: <DLGppJ.31C@undergrad.math.uwaterloo.ca>
- NNTP-Posting-Host: atgw-kip-1-94.dartmouth.edu
-
- In article <DLGppJ.31C@undergrad.math.uwaterloo.ca>,
- tthiraku@landen.math.uwaterloo.ca (Thanou Thirakul) wrote:
-
- > Hi..
- >
- > I'm currently stuck on how to overload [] operator such that
- > it does two different tasks..
- >
- >
- > case 1:
- >
- > // A is an instance of a class that contains a linkist.
- >
- > A[5] = val; // store val into the fifth node of a linklist.
- > val = A[5] ; // returns the value of the fifth node of a linklist.
- >
- >
- > I was wondering how can C++ differentiate these two senerios?
- >
- > Anything help will greatly appreciated..
- >
- > Thank You Kindly
- > --
- > Thanou Thirakul
- > tthiraku@undergrad.math.uwaterloo.ca
- > http://www.undergrad.math.uwaterloo.ca/~tthiraku
- > ___________________________________________________________
- > | |
- > | <after submitting a CS assignment> |
- > | |
- > | "Well, that was the most well-documented non-working |
- > | piece of code I have ever written.. " -unknown |
- > | |
- > |___________________________________________________________|
-
- The = assignment operator can not be overloaded.
-